﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Aplicacion/Vista/ModeloPrincipal.master" AutoEventWireup="true" CodeFile="IngresarMaterial.aspx.cs" Inherits="Aplicacion_Vista_IngresarMaterial" %>

<asp:Content ID="Content1" ContentPlaceHolderID="titulo" Runat="Server">
    <title>Administraci&oacute;n de Bodegas - Estimaci&oacute;n de  Material</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ruta" Runat="Server">
    <strong style="font-size:12px;">Inicio --> Principal <%:(String)Session["nombreRol"]%> --> Proyectos --> Crear estimaci&oacute;n de materiales al proyecto "<%:Request.QueryString["n"]%>" de tipo "<%:Request.QueryString["d"]%>" </strong>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="informacionSesion" Runat="Server">
    <div class="Block">
                            <div class="Block-body">
                                <div class="BlockHeader">
                                    <div class="header-tag-icon">
                                        <div class="BlockHeader-text">
                                            Informaci&oacute;n de sesi&oacute;n 
                                        </div>
                                    </div>
                                    <div class="l"></div>
                                    <div class="r"><div></div></div>
                                </div>
                                <div class="BlockContent">
                                    <div class="BlockContent-tl"></div>
                                    <div class="BlockContent-tr"><div></div></div>
                                    <div class="BlockContent-bl"><div></div></div>
                                    <div class="BlockContent-br"><div></div></div>
                                    <div class="BlockContent-tc"><div></div></div>
                                    <div class="BlockContent-bc"><div></div></div>
                                    <div class="BlockContent-cl"><div></div></div>
                                    <div class="BlockContent-cr"><div></div></div>
                                    <div class="BlockContent-cc"></div>
                                    <div class="BlockContent-body">
                                        <div>
                                            
                                            <table>
                                                <tr>
                                                    <td colspan="2">Usted se encuentra conectado como :</td>
                                                </tr>    
                                                <tr>
                                                    <td colspan = "2"><strong><%:(String)Session["nombreUsuario"]%></strong></td>
                                                </tr>
                                                <tr>
                                                    <td colspan = "2">Y su rol en el sistema es :</td>
                                                </tr>
                                                <tr>
                                                    <td colspan = "2"><strong><%:(String)Session["nombreRol"]%></strong></td>
                                                </tr>
                                                <tr>
                                                    <td colspan = "2"><asp:LinkButton ID="LinkButton1" runat="server" 
                                                            onclick="LinkButton1_Click">Cerrar Sesi&oacute;n</asp:LinkButton></td>
                                                </tr>    
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="menuLateral" Runat="Server">
    <div class="Block">
                            <div class="Block-body">
                                <div class="BlockHeader">
                                    <div class="header-tag-icon">
                                        <div class="BlockHeader-text">
                                            Men&uacute;
                                        </div>
                                    </div>
                                    <div class="l"></div>
                                    <div class="r"><div></div></div>
                                </div>
                                <div class="BlockContent">
                                <div class="BlockContent-tl"></div>
                                    <div class="BlockContent-tr"><div></div></div>
                                    <div class="BlockContent-bl"><div></div></div>
                                    <div class="BlockContent-br"><div></div></div>
                                    <div class="BlockContent-tc"><div></div></div>
                                    <div class="BlockContent-bc"><div></div></div>
                                    <div class="BlockContent-cl"><div></div></div>
                                    <div class="BlockContent-cr"><div></div></div>
                                    <div class="BlockContent-cc"></div>
                                    <div class="BlockContent-body">
                                        <ul>
                                                <li><a href="Proyectos.aspx">Volver atr&aacute;s</a></li>
                                                
                                        </ul>  
                                    </div>
                                </div>
                            </div>
                        </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="contenidoPagina" Runat="Server">
            <div class="Post">
                            <div class="Post-tl"></div>
                            <div class="Post-tr"><div></div></div>
                            <div class="Post-bl"><div></div></div>
                            <div class="Post-br"><div></div></div>
                            <div class="Post-tc"><div></div></div>
                            <div class="Post-bc"><div></div></div>
                            <div class="Post-cl"><div></div></div>
                            <div class="Post-cr"><div></div></div>
                            <div class="Post-cc"></div>
                            <div class="Post-body">
                        <div class="Post-inner">
                            <h2 class="PostHeaderIcon-wrapper">
                                <span class="PostHeader">Bienvenido <%:Session["nombreRol"]%></span>
                            </h2>
                            <div class="PostContent">
                                
                                <h1>Estimaci&oacute;n de materiales</h1>
                                <p>Para <strong>ingresar materiales a la estimaci&oacute;n de materiales de &eacute;ste proyecto</strong> , ingrese la informaci&oacute;n requerida en el formulario.
                                Si desea volver a la p&aacute;gina anterior sin ingresar materiales a la estimaci&oacute;n de materiales del proyecto , utilize el link <strong>Volver atr&aacute;s</strong>
                                 que se encuentra el el men&uacute; a su izquierda.<asp:Label ID="Label1" 
                                        runat="server" Text="Label"></asp:Label>
                                </p>
                                                 
                                <p>Modifique los siguientes campos referentes a los materiales que desea ingresar a la estimaci&oacute;n de materiales del proyecto :</p> 
                                
                                    
                                <div class="Block">
                            <div class="Block-body">
                                <div class="BlockHeader">
                                    <div class="header-tag-icon">
                                        <div class="BlockHeader-text">
                                            Formulario de estimaci&oacute;n de materiales 
                                        </div>
                                    </div>
                                    <div class="l"></div>
                                    <div class="r"><div></div></div>
                                </div>
                                <div class="BlockContent">
                                    <div class="BlockContent-tl"></div>
                                    <div class="BlockContent-tr"><div></div></div>
                                    <div class="BlockContent-bl"><div></div></div>
                                    <div class="BlockContent-br"><div></div></div>
                                    <div class="BlockContent-tc"><div></div></div>
                                    <div class="BlockContent-bc"><div></div></div>
                                    <div class="BlockContent-cl"><div></div></div>
                                    <div class="BlockContent-cr"><div></div></div>
                                    <div class="BlockContent-cc"></div>
                                    <div class="BlockContent-body">
                                    <div>
                                
                                    <table style="width:100%;">
                                                                                
                                        <tr>
                                            <td>
                                                Nombre material :
                                            </td>
                                            <td colspan="2">
                                                <asp:DropDownList ID="DropDownList1" runat="server" 
                                                    DataSourceID="ObjectDataSource1" DataTextField="Nombre" 
                                                    DataValueField="idMaterial" AutoPostBack="True" 
                                                    onselectedindexchanged="DropDownList1_SelectedIndexChanged" Height="24px" 
                                                    Width="280px">
                                                </asp:DropDownList>
                                                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                                                    SelectMethod="getMateriales" TypeName="ModeloIngresarMaterial">
                                                </asp:ObjectDataSource>
                                            </td>
                                            </tr>
                                            <tr>
                                            <td>
                                                SKU material :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DropDownList2" runat="server" 
                                                    DataSourceID="ObjectDataSource1" DataTextField="SKU" 
                                                    DataValueField="idMaterial" AutoPostBack="True" 
                                                    onselectedindexchanged="DropDownList2_SelectedIndexChanged" Height="24px" 
                                                    Width="280px">
                                                </asp:DropDownList>
                                            </td>
                                          <td>
                                                Unidad de medida :
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DropDownList4" runat="server" 
                                                    DataSourceID="ObjectDataSource1" DataTextField="UnidaddeMedida" 
                                                    DataValueField="idMaterial" Enabled="False" Height="24px" Width="183px">
                                                </asp:DropDownList>
                                            </td>  
                                        </tr>
                                        <tr>
                                        
                                            <td>
                                                cantidad : 
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DropDownList3" runat="server" Height="24px" Width="280px">
                                                <asp:ListItem Text="1"></asp:ListItem>
                                                <asp:ListItem Text="2"></asp:ListItem>
                                                <asp:ListItem Text="3"></asp:ListItem>
                                                <asp:ListItem Text="4"></asp:ListItem>
                                                <asp:ListItem Text="5"></asp:ListItem>
                                                <asp:ListItem Text="6"></asp:ListItem>
                                                <asp:ListItem Text="7"></asp:ListItem>
                                                <asp:ListItem Text="8"></asp:ListItem>
                                                <asp:ListItem Text="9"></asp:ListItem>
                                                <asp:ListItem Text="10"></asp:ListItem>
                                                <asp:ListItem Text="11"></asp:ListItem>
                                                <asp:ListItem Text="12"></asp:ListItem>
                                                <asp:ListItem Text="13"></asp:ListItem>
                                                <asp:ListItem Text="14"></asp:ListItem>
                                                <asp:ListItem Text="15"></asp:ListItem>
                                                <asp:ListItem Text="16"></asp:ListItem>
                                                <asp:ListItem Text="17"></asp:ListItem>
                                                <asp:ListItem Text="18"></asp:ListItem>
                                                <asp:ListItem Text="19"></asp:ListItem>
                                                <asp:ListItem Text="20"></asp:ListItem>
                                                <asp:ListItem Text="21"></asp:ListItem>
                                                <asp:ListItem Text="22"></asp:ListItem>
                                                <asp:ListItem Text="23"></asp:ListItem>
                                                <asp:ListItem Text="24"></asp:ListItem>
                                                <asp:ListItem Text="25"></asp:ListItem>
                                                <asp:ListItem Text="26"></asp:ListItem>
                                                <asp:ListItem Text="27"></asp:ListItem>
                                                <asp:ListItem Text="28"></asp:ListItem>
                                                <asp:ListItem Text="29"></asp:ListItem>
                                                <asp:ListItem Text="30"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                            </td>
                                            <td>
                                            <asp:Button ID="Button1" runat="server" Text="Agregar material" 
                                                    onclick="Button1_Click" Width="183px"/>
    
                                            </td>
                                        </tr>
                                        <asp:TextBox ID="TextBox2" runat="server" Visible="false"></asp:TextBox>
                                        <asp:TextBox ID="TextBox3" runat="server" Visible="false"></asp:TextBox>
                                    </table>
                                    <table style="width:100%;">
                                        <tr>
                                            <td>
                                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                                                    CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" 
                                                    PageSize="4" onpageindexchanging="GridView1_PageIndexChanging" 
                                                    HorizontalAlign="Center" onrowcommand="GridView1_RowCommand" Width="100%">
                                                    <AlternatingRowStyle BackColor="White" />
                                                    <Columns>
                                                        <asp:BoundField DataField="idMaterial" HeaderText="Id material" >
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="skuMaterial" HeaderText="SKU material" >
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="nombreMaterial" HeaderText="Nombre material" >
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="cantidadMaterial" HeaderText="Cantidad" >
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        </asp:BoundField>
                                                        <asp:ButtonField ButtonType="Image" 
                                                            ImageUrl="~/Aplicacion/Vista/iconos/Delete.png" Text="Quitar material" 
                                                            CommandName="quitar material" />
                                                    </Columns>
                                                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                                                    <SortedAscendingCellStyle BackColor="#FDF5AC" />
                                                    <SortedAscendingHeaderStyle BackColor="#4D0000" />
                                                    <SortedDescendingCellStyle BackColor="#FCF6C0" />
                                                    <SortedDescendingHeaderStyle BackColor="#820000" />
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Button ID="Button2" runat="server" 
                                                    Text="Guardar cambios en la estimación" onclick="Button2_Click" />
                                                    
                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                                    <asp:Button ID="Button3" runat="server"  
                                                    Text="Crear Documento" onclick="Button3_Click" 
                                                    ToolTip="Permite crear documento de solicitud de materiales" Visible="False" />  
                                            </td>
                                            <td>
                                                
                                            </td>
                                        </table>   
                                      
                                    <p style="color:Red;">
                                        <%
                                            if ((new ControladorIngresarMaterial().getDataMsg()) != "" && TextBox2.Text == "1" )
                                            {
                                                Response.Write(new ControladorIngresarMaterial().getDataMsg());
                                            } 
                                          
                                        %>
                                        </p>
                                    <p style="color:Red;">
                                       
                                        <%
                                            if ((new ControladorIngresarMaterial().getOpMsg()) != "" && (new ControladorIngresarMaterial().getErrorCode()) == "" && TextBox2.Text == "1")
                                            {
                                                Response.Write(new ControladorIngresarMaterial().getOpMsg());
                                            } 
                                          
                                        %>
                                     </p>

                                    <p style="color:Green;">
                                        <%
                                            if ((new ControladorIngresarMaterial().getOpMsg()) != "" && (new ControladorIngresarMaterial().getErrorCode()) == "1" && TextBox2.Text == "1")
                                            {
                                                Response.Write(new ControladorIngresarMaterial().getOpMsg());
                                            } 
                                          
                                        %>
                                     </p>
                                
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>                                  
                            </div>
                            <div class="cleared"></div>
                        </div>                        
                            </div>
                        </div>
</asp:Content>

